import fix_path

from nohubcleaner import *
from wipeouter import *
from wipeolder import *
from marketdata.models import *
from datetime import  datetime

class StatWipeOuter(WipeOutOner):
    fastdelete = True
    KIND = MarketStats

class HistWipeOuter(WipeOutOner):
    fastdelete = True
    KIND = MarketHistory

class TmpStatWipeOuter(WipeOutOner):
    fastdelete = True
    KIND = TmpMarketStats

class TmpHistWipeOuter(WipeOutOner):
    fastdelete = True
    KIND = TmpMarketHistory

class MSAttachWipeOuter(WipeOutOner):
    fastdelete = False
    KIND = MarketStatsAttach

class HistWipeOlder(WipeOlder):
    KIND = MarketHistory

    def _getdate(self,key):
        if key:
    	    return datetime.strptime(key.name()[15:25],"%Y-%m-%d").date()
    	else:
    	    return None
